package com.abbas.CayTcore.base

import com.abbas.CayTcore.entity.NetBean

open class CommCallback<T> {

    var onSuccess: ((data: NetBean<T>) -> Unit)? = null
    var onNetError: ((msg: String) -> Unit)? = null
    var onFailure: ((exception: Throwable) -> Unit)? = null

    fun onSuccess(block: (data: NetBean<T>) -> Unit) {
        onSuccess = block
    }

    fun onNetError(block: ((msg: String) -> Unit)) {
        onNetError = block
    }

    fun onFailure(block: (exception: Throwable) -> Unit) {
        onFailure = block
    }

}